<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">

<jsp:directive.page errorPage="/WEB-INF/dmv/ErrorPage.jsp"/>
<jsp:directive.page import="org.twndmv.dto.*"/>
<jsp:directive.page import="java.text.SimpleDateFormat"/>
<html>
    <title>Display Person</title>
    <body>

        <jsp:scriptlet>
        SimpleDateFormat formater = new SimpleDateFormat("MM/dd/yyyy");
        VehicleRegistrationDTO car = (VehicleRegistrationDTO)request.getAttribute("result");
        </jsp:scriptlet>

        Id: <%= car.getId() %><p/>
        Make: <%= car.getMake() %><p/>
        Model: <%= car.getModel() %><p/>
        Year: <%= car.getYear() %><p/>
        Color: <%= car.getColor() %><p/>
        TagNo: <%= car.getTagNo() %><p/>
        Vin: <%= car.getVin() %><p/>
        Expiration Date: <%= formater.format(car.getExpiration()) %><p/>
         
        Owners:
        <ul>
        <jsp:scriptlet>
                for(Object o: car.getOwners()) {
                    PersonDTO p = (PersonDTO)o;
                    String firstName = p.getFirstName();
                    String lastName = p.getLastName();
                    String url = "?id=" + p.getId() + "&amp;command=Get+Driver";
            </jsp:scriptlet>
                <li><a href="<%= url %>"><%= firstName %> <%= lastName %> </a></li>
            <jsp:scriptlet>
                }
            </jsp:scriptlet>
            </ul>
            
        <p/><a href="<%=request.getContextPath()%>/index.jsp">Go to Main Page</a>
    </body>
</html>